package com.portal.sso.core.config;

import com.portal.sso.core.model.ResponseTModel;

/**
 * @program: portal-sso
 * @description: 常量定义
 * @author: xuduo
 * @create: 2021-04-17 22:20
 * @Version: 1.0
 **/
public class SsoConfig {
    /**
     * 登录成功后重定向的url参数
     */
    public static final String SSO_REDIRECT_URL = "redirect_url";
    /**
     * cookie中存储tgt的key
     */
    public static final String SSO_COOKIE_TGT = "tgt";
    /**
     * 请求参数中包含的tgt的key
     */
    public static final String SSO_PARAMETER_TGT = "tgt";
    /**
     * cookie存储的根路径
     */
    public static final String SSO_COOKIE_PATH = "/";
    /**
     * Request的Header中存储tgt的key
     */
    public static final String SSO_HEADER_TGT = "User-Tgt";
    /**
     * 客户端的appid
     */
    public static final String SSO_APP_ID = "app_id";
    /**
     * jwt中使用的用户标识参数
     */
    public static final String SSO_USER_ID = "userId";
    /**
     * 门户生成jwt时使用的默认秘钥
     */
    public static final String SSO_APP_DEFAULT_SECRET = "xuduo";
    /**
     * 认证中心服务器
     */
    public static final String SSO_CLIENT_SERVER = "sso_server";
    /**
     * 客户端登出地址
     */
    public static final String SSO_CLIENT_LOGOUT_PATH = "sso_client_logout_path";
    /**
     * 客户端排除拦截资源
     */
    public static final String SSO_CLIENT_EXCLUDED_PATHS = "sso_client_excluded_paths";
    /**
     * 没有登录时跳转的登录地址属性
     */
    public static final String SSO_SERVER_LOGIN_PATHS = "sso_server_login_path";
    /**
     * 客户端uri风格
     */
    public static final String SSO_CLIENT_URI_STYLE = "sso_client_rui_style";



    public static final String SSO_CLIENT_VERIFICATION_PATH = "sso_client_verification_path";

    /**
     * 退出地址
     */
    public static final String SSO_LOGOUT = "/logout";
    /**
     * 登录地址
     */
    public static final String SSO_LOGIN = "/login";
    /**
     * 登录提交地址
     */
    public static final String SSO_LOGIN_ON = "/loginon";

    /**
     * 配置是否开启登录地址的前缀
     */
    public static final String SSO_PAGE_PREFIX = "portal.sso.login.page";
    /**
     * 配置是否开启登录地址的属性
     */
    public static final String SSO_PAGE_ENABLED="enabled";
    public static  final String SSO_VERSION_URL="/verification";
    /**
     * request中传给controller的key
     */
    public static final String SSO_REQUEST_USER_ID = "userId";
    /**
     * REST请求风格，举例：www.xuduo.com?abc=123
     */
    public static final String SSO_REQUEST_URI_TYPE_REST = "REST";
    /**
     * RESTFUL请求风格，举例：www.xuduo.com/abc/123
     */
    public static final String SSO_REQUEST_URI_TYPE_RESTFUL = "RESTFUL";

    public static final String SSO_RESPONSE_MODEL_WEB = "WEB";
    /**
     * 登录失败返回结果
     */
    public static final ResponseTModel<String> SSO_LOGIN_FAIL_RESULT = new ResponseTModel(501, "用户还没有登录.");
    /**
     * 错误结果的key传参
     */
    public static final String SSO_REQUEST_ERROR_MSG = "msg";

    /**
     * 前端加密的key
     */
    public static final String SSO_REQUEST_PWD_KEY = "4428802d03429ba2e219fd575c76ba55";
    /**
     * restfull方式登陆时是否启用加密标识
     */
    public static final String SSO_REQUEST_PWD_ENCRY = "yes";
}

